<?php 
	require 'global.php';
	$dir = ROOT.'/sites/main/';
	$handle = opendir($dir);
	$html_dir = array();
	while (false !== ($file = readdir($handle))) {
		if($file != '.' && $file !== '..' && $file !='.svn'){
			$cur_path = $dir . $file;
			if(is_dir($cur_path)){
				$html_dir[] = $file;
			}
		}
	}
	closedir($handle);
?>
<style>
	.update_form label{display:inline-block;width:120px;line-height:24px;}
</style>
<form class="update_form" action="/tool/creator/updater/updater.php" method="post">
	<table width="100%">
		<colgroup>
			<col width="25%"/>
			<col width="75%"/>
		</colgroup>
		<tr>
			<th>更新包保存目录：</th>
			<td><input type="text" value="D:/temp/Yulin" name="path" style="width:400px;"/></td>
		</tr>
		<tr>
			<th>更新截止时间：</th>
			<td>
				<input type="text" class="datepicker" name="date" value="<?php echo date('Y-m-d',time());?>"/>
				<select name="hour">
					<option>9</option>
					<option>10</option>
					<option>11</option>
					<option>12</option>
					<option>13</option>
					<option>14</option>
					<option>15</option>
					<option>16</option>
					<option>17</option>
					<option>18</option>
				</select>时
				<select name="min">
					<option>00</option>
					<option>15</option>
					<option>30</option>
					<option>45</option>
				</select>分
			</td>
		</tr>
		<tr>
			<th>更新不包含：</th>
			<td>
				<label><input type="checkbox" name="exp_dir[]" checked="checked" value=".svn"> .svn </label>
				<label><input type="checkbox" name="exp_dir[]" checked="checked" value=".settings"> .settings </label>
				<label><input type="checkbox" name="exp_dir[]" checked="checked" value="tool"> tool </label>
				<label><input type="checkbox" name="exp_dir[]" checked="checked" value="360"> 360 </label>
				<label><input type="checkbox" name="exp_dir[]" checked="checked" value="document"> document</label>
				<label><input type="checkbox" name="exp_dir[]" checked="checked" value="integrate.bak"> integrate.bak</label>
				<label><input type="checkbox" name="exp_dir[]" checked="checked" value="html"> html</label>
				<label><input type="checkbox" name="exp_dir[]" checked="checked" value=".buildpath"> .buildpath</label>
				<label><input type="checkbox" name="exp_dir[]" checked="checked" value=".project"> .project</label>
				<label><input type="checkbox" name="exp_dir[]" checked="checked" value="dummy.php"> dummy.php</label>
				<label><input type="checkbox" name="exp_dir[]" checked="checked" value="test.php"> test.php</label>
			</td>
		</tr>
		<tr>
			<th>是否打包：</th>
			<td>
				<label><input type="radio" disabled="disabled" name="zip" value="zip"/> zip</label>
				<label><input type="radio" disabled="disabled" name="zip" value="rar" /> rar</label>
				<label><input type="radio" disabled="disabled" name="zip" value="gz" /> gz</label>
			</td>
		</tr>
		<tr>
			<th>HTML:</th>
			<td>
				<select name="html">
					<option value="0">请选择要更新的站点</option>
				<?php 
					foreach ($html_dir as $html){
				?>
					<option value="<?php echo $html?>"><?php echo $html?></option>
				<?php }?>
				</select>
			</td>
		</tr>
		<tr>
			<td colspan="2" style="text-align:center;padding-top:0px;">
				<input type="submit" value="创建"/>
			</td>
		</tr>
	</table>
</form>
<script language="javascript">
	$(function(){
		$.datepicker.setDefaults($.datepicker.regional["zh-CN"]);
		$( ".datepicker" ).datepicker({'dateFormat':'yy-mm-dd'});
	});
</script>